home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / applied / init < prev    next >
Text File  |  2001-04-06  |  2KB  |  55 lines

  1. SYNOPSIS
  2.         void init()
  3.  
  4. DESCRIPTION
  5.         The main purpose of this function is to set up the
  6.         add_actions() of an object. Therefore init() will always be
  7.         called when an object moves near another object and one or
  8.         both of them are marked as living.
  9.         
  10.         The way init() will be invoked is determined in the following
  11.         manner:
  12.         
  13.         If the object O that moves is marked as living then first call
  14.         init() of the destination object D with this_player() set to O.
  15.         
  16.         Then apply the two following rules for each object C inside D:
  17.         
  18.                 If C is marked as living then call O->init() with
  19.                 this_player() set to C.
  20.         
  21.                 If O is marked as living then call C->init() with
  22.                 this_player() set to O.
  23.         
  24.         Finally, if D is marked as living then call O->init(), with
  25.         this_player() set to D.
  26.  
  27.         With 3.2.1, the actual move handling is part of the object
  28.         library, so a given installation may implement any other
  29.         scheme of calling init(), therefore rendering the following
  30.         example almost useless.
  31.  
  32. EXAMPLE
  33.         Lets say we have a object structure of living (l1 and l2) and
  34.         non living objects (n1 and n2) as the following:
  35.         
  36.         l1
  37.            n1
  38.            l2
  39.            n2
  40.         
  41.         If we now move another living object l3 into l1, the call
  42.         suequence of the init() functions looks like this:
  43.         
  44.         l1->init()  first init() of the destination will be called
  45.         n1->init()  now iterate throw the inventory of the destination
  46.         l3->init()
  47.         l2->init()
  48.         n2->init()
  49.         l3->init()  and finally call init() of the object that has
  50.                     been moved
  51.  
  52. SEE ALSO
  53.         add_action(E), efun308(E), environment(E), move_object(E),
  54.         hooks(C)
  55.